


// 文件流读写超大的文件 
var fs = require("fs")
var zlib = require("zlib")
var readStream = fs.createReadStream("data/my.json",{encoding:'utf8'});
// var writeStream = fs.createWriteStream("data/my1.json",{encoding:'utf8'});
var writeStream = fs.createWriteStream("data/my2.json.gz",{encoding:'utf8'});

// pipe管道输送  文件流读写数据  
readStream
.pipe(zlib.createGzip()) // 压缩 
.pipe(writeStream)

